/*
 * Created by SharpDevelop.
 * User: rseward
 * Date: 6/4/2008
 * Time: 3:30 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Collections.Generic;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;

using AvvaMobileNHibernateHelperKit;

namespace TestNHibernateHelperKit
{
	[TestFixture]
	public class TestNameFormatter
	{
		private CamelCaseNameFormatter formatter = new CamelCaseNameFormatter();
		private Dictionary<string,string> tables = new Dictionary<string,string>();
		
		private void doClassTest(string tableName, string expectedClass)
		{
			string className = formatter.GetClassName( tableName );
			
			Console.WriteLine( tableName + " -> "+ className );
			Assert.AreEqual( expectedClass , className, "Not quite the right classname");
		}
		
		
		[TestFixtureSetUp]
		public  void Setup()
		{
			tables["instrument"] = "Instrument";
			tables["log"] = "Log";
			tables["test_result_variable"] = "TestResultVariable";
			tables["military_unit"] = "MilitaryUnit";
		}
		
		[Test]
		public void TestMethod()
		{
			// Kick the tires on the Name Formatter
			
			foreach (string tableName in tables.Keys) {
				doClassTest(tableName, tables[ tableName ] );
			}
		}
	}
}
